package com.ms.game.invitefriend.db;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.ms.game.invitefriend.bin.InviteCodeType;
import com.xpec.c4.db.model.basic.BasicModel;
import com.xpec.c4.game.utility.GUIDFactory;
import com.xpec.c4.game.utility.GUIDType;


@Entity
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@Table(name = "invite_code_groups")
public class InviteCodeGroupModel extends BasicModel{

	/**
	 * 
	 */
	private static final long serialVersionUID = -4920253521496630054L;

	public InviteCodeGroupModel(){
		createTime = new Date();
		groupId = GUIDFactory.createUUID(GUIDType.TYPE_INVITE_CODE).toString();
	}
	
	private int id;	
	
	/**
	 * 建立時間
	 */
	private Date createTime;		
	
	/**
	 * 結束時間
	 */
	private Date endTime;	
	
	/**
	 * 此組邀請碼的序號
	 */
	private String groupId;	
	
	/**
	 * 此組邀請碼的名稱
	 */
	private String groupName;	
	
	/**
	 * 此組邀請碼的總數
	 */
	private int totalCount;	
		
	/**
	 * 此組邀請碼給的C幣
	 */
	private String goldCoins;	
	
	/**
	 * 此組邀請碼給的道具
	 */
	private String items;	
	
	private InviteCodeType type;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@Column(columnDefinition = "VARCHAR(255) BINARY CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL  COMMENT '邀請碼的群組ID' ")
	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	@Column(columnDefinition = "VARCHAR(255) BINARY CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL  COMMENT '邀請碼群組的產品名稱' ")
	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	//@Column(columnDefinition ="COMMENT '總數'")
	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	@Column(columnDefinition = "VARCHAR(255) BINARY CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'C幣'")
	public String getGoldCoins() {
		return goldCoins;
	}

	public void setGoldCoins(String goldCoins) {
		this.goldCoins = goldCoins;
	}
	
	@Column(columnDefinition = "VARCHAR(255) BINARY CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL  COMMENT '道具' ")
	public String getItems() {
		return items;
	}

	public void setItems(String items) {
		this.items = items;
	}

	@Enumerated(EnumType.STRING)
	//@Column(columnDefinition = " COMMENT '邀請碼的類型'")
	public InviteCodeType getType() {
		return type;
	}

	public void setType(InviteCodeType type) {
		this.type = type;
	}
}
